﻿using Duende.IdentityServer.Validation;
using SimpleSaasAuth.Services;
using System.DirectoryServices;

namespace SimpleSaasAuth.Configuration.Validator
{
	public class WeChatOpenValidator : IExtensionGrantValidator
	{
		public string GrantType => "weixinopen";

		private IUserVerifyService userVerifyService;
		public WeChatOpenValidator(IUserVerifyService userVerifyService)
		{
			this.userVerifyService = userVerifyService;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="context"></param>
		/// <returns></returns>
		public async Task ValidateAsync(ExtensionGrantValidationContext context)
		{

			//string openId = context.Request.Raw["openId"] == null ? "" : context.Request.Raw["openId"];
			//context.Result =true ;//await _userVerify.Login(new LoginParameter() { OpenID = openId }, "微信账号未绑定!", eAuthenticationType.WeChatId);
		}
	}
}